package com.hfzy.ihk.facade.linkcall.enums;

import com.hfzy.ihk.common.facade.CustomEnumType;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/19.
 *
 * @author wws
 */
public enum SpeakingFlowStepType implements CustomEnumType {

    COMMON("c", "普通话术"),
    MUTI_SESSION_SKIP("m", "多轮会话跳转话术"),
    SKIP("s", "跳转话术");


    private SpeakingFlowStepType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    private String value;

    private String desc;

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    private static Map<String, SpeakingFlowStepType> map = new HashMap<>();
    static {
        for (SpeakingFlowStepType value : SpeakingFlowStepType.values()) {
            map.put(value.getValue(), value);
        }
    }

    public static SpeakingFlowStepType fromValue(String value) {
        SpeakingFlowStepType ret = map.get(value);
        if (ret != null) {
            return ret;
        } else {
            throw new IllegalArgumentException("No enum const " + SpeakingFlowStepType.class + "." + value);
        }
    }

}
